// 8085Doc.h : interface of the CMy8085Doc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_8085DOC_H__0769A9CC_7890_11D2_8060_00A0C91F41A7__INCLUDED_)
#define AFX_8085DOC_H__0769A9CC_7890_11D2_8060_00A0C91F41A7__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "crystal/CCrystalTextBuffer.h"
#include "8085Object.h"
#include "Parse.h"
#include "DebugData.h"
#include "BreakPoint.h"

class CMy8085Doc : public CDocument, public CBreakPoint
{

protected: // create from serialization only
	CMy8085Doc();
	DECLARE_DYNCREATE(CMy8085Doc)

// Attributes
public:
	class CSampleTextBuffer : public CCrystalTextBuffer
	{
	private:
		CMy8085Doc *m_pOwnerDoc;
	public:
		CSampleTextBuffer(CMy8085Doc *pDoc) { m_pOwnerDoc = pDoc; };
		virtual void SetModified(BOOL bModified = TRUE)
			{ m_pOwnerDoc->SetModifiedFlag(bModified); };
	};

	CSampleTextBuffer m_xTextBuffer;
	LOGFONT m_lf;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMy8085Doc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	virtual void OnCloseDocument();
	virtual void DeleteContents();
	virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
	virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
	//}}AFX_VIRTUAL

// Implementation
public:
	void		Init();
	BOOL		IsAnimating();
    void		SetAnimating(BOOL bAnimating=TRUE);
	void		SetIgnoreInputs(BOOL bIgnore=TRUE);
	void		ParseFile(const CString& fileName);
    CParse*		GetParserObject(void);
    C8085Object* Get8085Object(void);
    BOOL		IsDisplayOpen();  // is the 8085 display open 
    BOOL		IgnoreInputs();
    void		SetDisplayOpen(BOOL set=TRUE); // set m_8085DisplayOpen to TRUE or FALSE
	virtual		~CMy8085Doc();

    // Functions to manipulate breakpoints
    void		AddBkPt(word address,int nSrcLine=-1, BOOL initial_state = TRUE );
	void		RemoveBkPtFromCode();
	void		InsertBkPtInCode(BOOL bRefresh=1);
	void		ToggleBkPt(word addr,int nSrcLine=-1);

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

    // data members
public:
    CDebugData		m_cDebugInfo;    // standard way of storing debug data
	static BOOL		m_bMiniHelp;
	static BOOL		m_bSyntaxHighlighting;

protected:
    CParse			m_Parser;
    C8085Object		m_8085Object;       // the 8085 object
    BOOL			m_b8085DisplayOpen; // is the display open?
    BOOL			m_bIgnoreInputs;    // set to TRUE when the simulator is running and
                                    // keyboard inputs are to be disable
    int				m_bIsAnimating;     // set to true if animation is going on

// Generated message map functions
protected:
	//{{AFX_MSG(CMy8085Doc)
	afx_msg void OnReadOnly();
	afx_msg void OnUpdateReadOnly(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_8085DOC_H__0769A9CC_7890_11D2_8060_00A0C91F41A7__INCLUDED_)
